package com.xxgc.eow.service.impl;

import com.xxgc.eow.entity.Treatment;
import com.xxgc.eow.mapper.TreatmentMapper;
import com.xxgc.eow.service.ITreatmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 企业待遇表 服务实现类
 * </p>
 *
 * @author Mr.Abel
 * @since 2023-05-22
 */
@Service
public class TreatmentServiceImpl extends ServiceImpl<TreatmentMapper, Treatment> implements ITreatmentService {

    @Resource
    private TreatmentMapper treatmentMapper;

    @Override
    public List<Treatment> getAllTreatment() {
        return treatmentMapper.selectAll();
    }

    @Override
    public int addTreatment(Treatment treatment) {
        return treatmentMapper.insert(treatment);
    }

    @Override
    public int delTreatment(Treatment treatment) {
        return treatmentMapper.delectTreatment(treatment);
    }

    @Override
    public int updatTreatment(Treatment treatment, int oldTreatmentId) {
        return treatmentMapper.updatTreatment(treatment,oldTreatmentId);
    }

    @Override
    public List<Treatment> getAllByCompanyId(int companyId) {
        return treatmentMapper.selectAllByCompanyId(companyId);
    }
}
